﻿@model MembershipUserCollection
@{
    ViewBag.Title = "Používatelia";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section head {

    <link href="@Url.Content("~/footable/css/footable.core.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/footable/css/footable.standalone.css")" rel="stylesheet" type="text/css" />
  
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.sort.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.filter.js")" type="text/javascript"></script>
    
    <script type="text/javascript">
        $(function () {
            $("table").footable();

            $(".clear-filter").click(function (e) {
                e.preventDefault();
                $("table").trigger("footable_clear_filter");
            });
        });
    </script>
}

<h2>Používatelia</h2>

<p>
    Prehľad všetkých používateľov portálu AtletIS
</p>

<div class="filter-frame">
        
    <div class="filter-item">
        <div class="editor-label">
            Vyhľadávanie:
        </div>
        <div class="editor-field">
            @Html.TextBox("text-filter")
        </div>
    </div>

    <div class="filter-item">
        <div class="editor-label">
            <a href="#clear" class="clear-filter" title="clear filter">Zrušiť filter</a>
        </div>
    </div>

</div>

<p>
    @Html.ActionLink("< Administrácia", "Index", "Home", new { area = "Admin" }, null) |
    @Html.ActionLink("Pridať nového používateľa", "Register", "Account", new { area = "" }, null)
</p>

<table class="footable table toggle-arrow-tiny" data-filter="#text-filter" data-filter-minimum="3">
    <thead>
        <tr>
            <th data-class="expand" data-sort-initial="ascending">
                Login
            </th>
            <th>
                Email
            </th>
            <th data-hide="phone,tablet">
                Posledný prístup
            </th>
            <th width="60px" data-sort-ignore="true"></th>
        </tr>
    </thead>
    <tbody>
    @foreach (MembershipUser item in Model)
    { 
        <tr>
            <td>
                @item.UserName
            </td>
            <td>
                @item.Email
            </td>
            <td>
                @item.LastLoginDate
            </td>
            <td>
                @Html.ActionLink("Role", "GetRoles", new { UserName = item.UserName})
            </td>
        </tr>
    }
    </tbody>
</table>